using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class ErrorDebuggerShower : MonoBehaviour
{
    public TextMeshProUGUI ErrorShowTextMeshProUGUI;
    private void Awake()
    {
        Debug.Log(Application.streamingAssetsPath);
        Debug.Log(Application.persistentDataPath);
        Get_Error();

        DontDestroyOnLoad(gameObject);
    }

    public void Get_Error()
    {
        Application.logMessageReceived += (string condition, string stackTrack, LogType type) =>
        {
            if(type == LogType.Exception || type == LogType.Error || type == LogType.Log)
            {
                ErrorShowTextMeshProUGUI.SetText(condition + "\n" + stackTrack);
            }
        };
    }
}
